﻿<div class="usuarios view">
<h2><?php  __('Usuário');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $usuario['Usuario']['id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Nome Completo'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $usuario['Usuario']['nome_completo']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Email'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $usuario['Usuario']['email']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Senha'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $usuario['Usuario']['senha']; ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Editar usuário', true), array('action' => 'edit', $usuario['Usuario']['id'])); ?> </li>
		<li><?php echo $html->link(__('Apagar usuário', true), array('action' => 'delete', $usuario['Usuario']['id']), null, sprintf(__('Você tem certeza que deseja apagar o registro # %s?', true), $usuario['Usuario']['id'])); ?> </li>
		<li><?php echo $html->link(__('Listar usuários', true), array('action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('Novo usuário', true), array('action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('Listar sites', true), array('controller' => 'sites', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('Novo site', true), array('controller' => 'sites', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php __('Sites relacionados');?></h3>
	<?php if (!empty($usuario['Site'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('Nome'); ?></th>
		<th><?php __('Id usuário'); ?></th>
		<th class="actions"><?php __('Ações');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($usuario['Site'] as $site):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $site['id'];?></td>
			<td><?php echo $site['nome'];?></td>
			<td><?php echo $site['usuario_id'];?></td>
			<td class="actions">
				<?php echo $html->link(__('Ver', true), array('controller' => 'sites', 'action' => 'view', $site['id'])); ?>
				<?php echo $html->link(__('Editar', true), array('controller' => 'sites', 'action' => 'edit', $site['id'])); ?>
				<?php echo $html->link(__('Apagar', true), array('controller' => 'sites', 'action' => 'delete', $site['id']), null, sprintf(__('Você tem certeza que deseja apagar o registro # %s?', true), $site['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('Novo site', true), array('controller' => 'sites', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
